package cn.edu.xmu.restfuldemo.controller;

import cn.edu.xmu.restfuldemo.service.GoodsSkuService;
import cn.edu.xmu.restfuldemo.util.Common;
import cn.edu.xmu.restfuldemo.util.ReturnObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Zijun Min
 * @description
 * @createTime 2021/10/22 17:50
 **/
@RestController
public class GoodsSkuController {
    @Autowired
    private GoodsSkuService goodsSkuService;

    @GetMapping("/sku/dao/{id}")
    public Object getGoodsSkuByDao(@PathVariable("id") Long id) {
        ReturnObject returnObject = goodsSkuService.findGoodsSkuDao(id);
        return Common.getRetObject(returnObject);
    }

    @GetMapping("/sku/sql/{id}")
    public Object getGoodsSkuBySql(@PathVariable("id") Long id) {
        ReturnObject returnObject = goodsSkuService.findGoodsSkuSql(id);
        return Common.getRetObject(returnObject);
    }
}
